package entityJPA;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * The persistent class for the positioncomment database table.
 * 
 */
@Entity
@Table(name = "positioncomment")
@NamedQuery(name = "Positioncomment.findAll", query = "SELECT p FROM Positioncomment p")
public class Positioncomment implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(unique = true, nullable = false)
	private int idPositionComment;

	@Column(nullable = false, length = 200)
	private String comment;

	// uni-directional many-to-one association to Position
	@ManyToOne
	@JoinColumn(name = "idPosition", nullable = false)
	private Position position;

	// uni-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name = "idUser", nullable = false)
	private User user;

	public Positioncomment() {
	}

	public int getIdPositionComment() {
		return this.idPositionComment;
	}

	public void setIdPositionComment(int idPositionComment) {
		this.idPositionComment = idPositionComment;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Position getPosition() {
		return this.position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String toString() {
		return this.idPositionComment + " " + this.comment + " "
				+ this.position.getName() + " " + this.user.getFirstName()
				+ " " + this.user.getLastName();
	}

}